<?php
require("../../class/connect.php");
require("../../class/user.php");
require("../../class/db_sql.php");
$link=db_connect();
$empire=new mysqlquery();
$editor=1;
//關閉
if($public_r[register_ok])
{
	printerror("CloseRegister","history.go(-1)",1);
}
//轉向註冊
if(!empty($registerurl))
{
	Header("Location:$registerurl");
	exit();
}
//已經登陸不能註冊
if(getcvar('mluserid'))
{
	printerror("LoginToRegister","history.go(-1)",1);
}
if(!empty($changeregisterurl)&&!$_GET['groupid'])
{
	Header("Location:$changeregisterurl");
	exit();
}

$groupid=(int)$_GET['groupid'];
$groupid=$groupid?$groupid:$user_groupid;
CheckMemberGroupCanReg($groupid);
$formid=GetMemberFormId($groupid);
if(empty($formid))
{
	printerror('ErrorUrl','',1);
}
$ecmsfirstpost=1;
$formfile='../../data/html/memberform'.$formid.'.php';
//導入模板
require(ECMS_PATH.'e/template/member/register.php');
db_close();
$empire=null;
?>